//
//  FoodUpdateTableViewCell.m
//  ArtOfLiving
//
//  Created by xalo on 16/4/30.
//  Copyright © 2016年 刘虎. All rights reserved.
//

#import "FoodUpdateTableViewCell.h"
#import "FoodMainModel.h"

@interface FoodUpdateTableViewCell ()

@property (strong, nonatomic) IBOutlet UIImageView *foodImageView;  //食物图片
@property (strong, nonatomic) IBOutlet UILabel *foodTitleLabel;     //食物名称
@property (strong, nonatomic) IBOutlet UILabel *foodDurationLabel;  //烹饪时间
@property (strong, nonatomic) IBOutlet UILabel *foodCalLabel;       //食物热量
@property (strong, nonatomic) IBOutlet UILabel *foodCollectionLabel;//收藏数
@property (strong, nonatomic) IBOutlet UILabel *foodNoticeLabel;    //食物功效


@end

@implementation FoodUpdateTableViewCell

- (void)setCellWithModel:(id)model{
    
    FoodMainModel *foodMainModel = model;
    SDWebImageOptions options = SDWebImageRetryFailed | SDWebImageLowPriority;
    [self.foodImageView sd_setImageWithURL:[NSURL URLWithString:foodMainModel.img] placeholderImage:[UIImage imageNamed:@"foodPlaceholdel.png"] options:options];
    self.foodTitleLabel.text = foodMainModel.title;
    self.foodDurationLabel.text = [NSString stringWithFormat:@"烹饪时间：%@",foodMainModel.duration];
    self.foodCalLabel.text = [NSString stringWithFormat:@"热量：%@kcal",foodMainModel.calories];
    self.foodCollectionLabel.text = [NSString stringWithFormat:@"收藏 %@",foodMainModel.collection_count];
    self.foodNoticeLabel.text = [[foodMainModel.effectMArr objectAtIndex:0] name];
}



/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
